<?php

namespace App\Models;

/**
 * 充值记录
 * Class RechargeLog
 *
 * @package App\Models
 * @property int $id
 * @property int $uid 用户id
 * @property int $order_id 订单id
 * @property int $recharge_credit 充值积分
 * @property string $recharge_money 充值余额金额
 * @property string $give_money 赠送金额
 * @property int $give_credit 赠送积分
 * @property int $type 充值类型:1余额充值 2积分充值
 * @property int $from 充值方式:1现金充值 2后台充值 3.后台扣款
 * @property int $state 充值方式:0充值失败，1充值成功
 * @property string $remark 备注
 * @property int $operator 后台操作员id
 * @property \Illuminate\Support\Carbon $created_at
 * @property \Illuminate\Support\Carbon $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog query()
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereFrom($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereGiveCredit($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereGiveMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereOperator($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereOrderId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereRechargeCredit($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereRechargeMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereRemark($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereState($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereUid($value)
 * @method static \Illuminate\Database\Eloquent\Builder|RechargeLog whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property-read \App\Models\User $user
 */
class RechargeLog extends BaseModel
{
    protected $guarded = [];
    protected $dateFormat = 'U';

    public function user()
    {
        return $this->belongsTo(User::class, 'uid', 'id');
    }
}